import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TPetSpecialSkill } from "../../../Message/Db/Tables/TPetSpecialSkill";
type int = number;
//class PetSpecialSkillConfig
    
    export  class PetSpecialSkillConfig
    {
        constructor()
        {
            
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_special_skill.json");
            this._dic = new Map<any, any> /* flash.utils.Dictionary */();
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TPetSpecialSkill();
                loc1.level = loc2.level;
                loc1.experience = loc2.experience;
                this._dic[loc1.level] = loc1;
            }
            return;
        }

        public getExperienceByLevel(arg1: int): int
        {
            var loc1=this._dic[arg1] as TPetSpecialSkill;
            if (loc1) 
            {
                return loc1.experience;
            }
            return 0;
        }

        public static get instance(): PetSpecialSkillConfig
        {
            if (PetSpecialSkillConfig._instance == null) 
            {
                PetSpecialSkillConfig._instance = new PetSpecialSkillConfig();
            }
            return PetSpecialSkillConfig._instance;
        }

        /* internal */ /* var */_dic: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PetSpecialSkillConfig;
    }
